package com.oscar.ehome.utils.selfdialog;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.oscar.ehome.R;


/**
 * 版本更新页面
 *
 * @author mengwanhe
 */
public class CustomUpdateDialog extends Dialog {

    /**
     * 更新页面
     */
    public static LinearLayout update_layout;
    /**
     * 取消按钮
     */
    public static ImageView update_cha;
    /**
     * 确定按钮
     */
    public static ImageView update_app;
    /**
     * 进度
     */
    public static ProgressBar mProgress;
    /**
     *
     */
    public static TextView updatemessge_text;
    /**
     *
     */
    public static LinearLayout cha_layout;


    public CustomUpdateDialog(Context context) {
        super(context, R.style.CustomDialogs);
        // TODO Auto-generated constructor stub
        setCustomDialog();
    }

    private void setCustomDialog() {
        View mView = LayoutInflater.from(getContext()).inflate(R.layout.update_progress, null);
        update_layout = (LinearLayout) mView.findViewById(R.id.update_layout);
        update_cha = (ImageView) mView.findViewById(R.id.update_cha);
        update_app = (ImageView) mView.findViewById(R.id.update_app);
        updatemessge_text = (TextView) mView.findViewById(R.id.updatemessge_text);
        cha_layout = (LinearLayout) mView.findViewById(R.id.cha_layout);
        super.setContentView(mView);
    }


    @Override
    public void setContentView(int layoutResID) {
    }

    @Override
    public void setContentView(View view, LayoutParams params) {
    }

    @Override
    public void setContentView(View view) {
    }

    /**
     * 确定键监听器
     *
     * @param listener
     */
    public void setOnPositiveListener(View.OnClickListener listener) {
        update_app.setOnClickListener(listener);
    }

    /**
     * 取消键监听器
     *
     * @param listener
     */
    public void setOnNetiveListener(View.OnClickListener listener) {
        update_cha.setOnClickListener(listener);
    }

}


